package gitTest;

import java.util.Scanner;
public class Demo {

	public static void main(String[] args) {
		
		Boolean flag=true;
		while(flag) {
			Test test=new Test();
			Test.show();
			Scanner scanner=new Scanner(System.in);
			int a=scanner.nextInt();
			scanner.nextLine();
		switch(a) {
		case 1:
			System.out.println("========================");
		    System.out.println("   欢迎使用密码管理系统");
		    System.out.println("========================");
		    System.out.print("请输入要加密的数字密码:");
		    String password=scanner.nextLine();
		    test.password=password;
		    test.encrypt();
		    System.out.println("加密完成，返回菜单！");
		    break;
		case 2:
			System.out.println("========================");
		    System.out.println("   欢迎使用密码管理系统");
		    System.out.println("========================");
		    System.out.print("请输入要解密的数字密码:");
		    String password1=scanner.nextLine();
		    test.password=password1;
		    test.decrypt();
		    System.out.println("解密完成，返回菜单！");
		    break;
		case 3:
			System.out.println("========================");
		    System.out.println("   欢迎使用密码管理系统");
		    System.out.println("========================");
		    System.out.print("请输入要判断的数字密码:");
		    String password2=scanner.nextLine(); 
		    test.password=password2;
		    test.judge();
		    System.out.println("判断完成，返回菜单！");break;
		case 4:
			System.out.println("========================");
		    System.out.println("   欢迎使用密码管理系统");
		    System.out.println("========================");
		    System.out.print("请输入要生成密码长度:");
		    int n=scanner.nextInt();
		    scanner.nextLine();
		    test.prodpwd(n);
		    System.out.println("判断完成，返回菜单！");
		break;
		case 5:
				flag=false;
				scanner.close();
				System.out.println("感谢使用本系统！");
		}
		}

	}

}
